#!/bin/bash

set -e

INSTALL_HOME="$(cd "$(dirname "$0")" && pwd)"

PID=$(ps -ef | grep "${INSTALL_HOME}/rocketmq_exporter" | grep -v grep | awk '{print $2}')
if [ -n "$PID" ]; then
    echo "Killing process $PID"
    kill -9 $PID
else
    echo "No matching process found"
fi
